package com.bw.common.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author qpxbo
 */
@Data
@NoArgsConstructor
public class ResultVO implements Serializable {

    private String code;

    private String msg;

    private Object object;

    public ResultVO(String code, String msg, Object object) {
        this.code = code;
        this.msg = msg;
        this.object = object;
    }

    public static ResultVO success(){
        return new ResultVO("200","操作成功",null);
    }
    public static ResultVO success(Object o){
        return new ResultVO("200","操作成功",o);
    }


    public static ResultVO success(String code,String msg,Object o){
        return new ResultVO(code,msg,o);
    }

    public static ResultVO fail(){
        return new ResultVO("500","操作失败",null);
    }


    public static ResultVO fail(String code,String msg,Object o){
        return new ResultVO(code,msg,o);
    }
}
